using System;
using System.Reflection;
using NBody;
using NBody.InitialConditions;
using OptionParser;

[assembly: AssemblyTitle ("NBodyPlummer")]
[assembly: AssemblyVersion ("1.0.*")]
[assembly: AssemblyDescription ("Build a plummer sphere")]
[assembly: AssemblyCopyright ("2005 Joseph D. MacMillan")]

public class PlummerOptions : OutputGetOptions
{
    [Option ("-n", "Number of particles")]
    public int N;
    
    [Option ("-c", "Adjust for centre of mass")]
    public bool CentreOfMass;
    
    public PlummerOptions()
    {
        N = 10000;
    }
}

public class NBodyPlummer
{
    public static void Main(string[] args)
    {
        PlummerOptions opts = new PlummerOptions();
        opts.ProcessArgs(args);
        
        NBodySystem s = new Sphere(1.0, 1.0, 1.0).GeneratePlummer(opts.N, 0.0, 0);
        
        if (opts.CentreOfMass)
            s.AdjustForCentreOfMass();
        
        s.Write(opts.OutFile);
    }
}
